package com.yixun.qfbao.hander;

import com.yixun.qfbao.api.service.PremisesApiService;
import com.yixun.qfbao.apidto.GetPremisesCMSmsPageReqDto;
import com.yixun.qfbao.apidto.GetPremisesCMSmsPageResDto;
import com.yixun.qfbao.dto.base.BaseRequestDTO;
import com.yixun.qfbao.dto.base.BaseResponseDTO;
import com.yixun.qfbao.hander.base.CommonAbstractHander;
import com.yixun.qfbao.vo.GetPremisesCMSmsListReqVo;
import com.yixun.qfbao.xf.model.enums.ResultEnum;
import com.yixun.qfbao.xf.service.CaseMemberService;
import com.yixun.qfbao.xf.service.PremisesService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 楼盘驻守人员及人员驻守的其他楼盘
 * 
 * @author JHSong
 *		
 */
@Service("getPremisesCMSmsListHander")
public class GetPremisesCMSmsListHander extends CommonAbstractHander {
	private static Logger logger= LoggerFactory.getLogger(GetPremisesCMSmsListHander.class);
	@Autowired
	private PremisesApiService premisesApiService;

	@SuppressWarnings("rawtypes")
	@Override
	public BaseResponseDTO doBusiness(BaseRequestDTO reqDto) {
		GetPremisesCMSmsListReqVo req = (GetPremisesCMSmsListReqVo)reqDto;
		GetPremisesCMSmsPageReqDto reqDto1 = req.getParams();
		BaseResponseDTO<GetPremisesCMSmsPageResDto> res = new BaseResponseDTO<GetPremisesCMSmsPageResDto>();
		GetPremisesCMSmsPageResDto resDto = new GetPremisesCMSmsPageResDto();
		try {
			resDto = premisesApiService.getPremisesCMSmsPage(reqDto1);
			resDto.setResult(ResultEnum.SUCCESS.getNo());
		} catch (Exception e) {
			logger.error("GetPremisesCMSmsListHander error: {}", e);
			resDto.setResult(ResultEnum.FAIL.getNo());
			resDto.setResultMsg("楼盘驻守人员列表获取失败!");
		}
		res.setResData(resDto);
		res.setResult(resDto.getResult());
		return res;
	}
	
}
